﻿using Eassets.Layered.Domain.Asset;
using Eassets.Data.Asset;
using System.Collections.ObjectModel;

namespace Eassets.Service.Asset
{
    public class TransactionService
    {

        TransactionData transactiondata = new TransactionData();

        /// <summary>
        /// Inserts transaction.
        /// </summary>
        /// <param name="transaction"></param>
        public void AddTransaction(Transaction transaction)
        {
            transactiondata.AddTransaction(transaction);
        }

        /// <summary>
        /// Updates transaction.
        /// </summary>
        /// <param name="transaction"></param>
        public void ModifyTransaction(Transaction transaction)
        {
            if (transaction != null)
            {
                transactiondata.ModifyTransaction(transaction);
            }
        }

        /// <summary>
        /// Delete transaction.
        /// </summary>
        /// <param name="transactionId"></param>
        public void DeleteTransaction(long transactionId)
        {
            if (transactionId != 0)
            {
                transactiondata.DeleteTransaction(transactionId);
            }
        }

        /// <summary>
        /// GetbyId transaction.
        /// </summary>
        /// <param name="transactionId"></param>
        /// <returns></returns>
        public Transaction GetByIdTransaction(long transactionId)
        {
            return transactiondata.GetByIdTransaction(transactionId);
        }

        /// <summary>
        /// GetAll transaction.
        /// </summary>
        /// <returns></returns>
        public Collection<Transaction> GetAllTransaction()
        {
            return transactiondata.GetAllTransaction();
        }

        /// <summary>
        /// Get Max Transaction Number for insert Disposal Details Table 
        /// </summary>
        /// <returns></returns>
        public long GetMaxTransactionNumber()
        {
            return transactiondata.GetMaxTransactionNumber();
        }

        /// <summary>
        /// Get Max Transaction Number for insert Disposal Details Table
        /// </summary>
        /// <returns></returns>
        public long GetMaxTransactionId()
        {
            return transactiondata.GetMaxTransactionId();
        }

        public string GetTransactionStatusByAssetCode(string assetCode)
        {
            return transactiondata.GetTransactionStatusByAssetCode(assetCode);
        }

        public long GetTransactionIdByTransactionNo(string transactionNo)
        {
            return transactiondata.GetTransactionIdByTransactionNo(transactionNo);
        }

        public Collection<Transaction> GetAllTransactionByTransactionDocumentCode(string code)
        {
            return transactiondata.GetAllTransactionByTransactionDocumentCode(code);
        }

        public string GetEmployeeNameByTransactionId(long transactionId)
        {
            return transactiondata.GetEmployeeNameByTransactionId(transactionId);
        }

        public Collection<AssetProcurementDetails> GETAssetDetailsByTransactionId(long transactionId)
        {
            return transactiondata.GETAssetDetailsByTransactionId(transactionId);
        }

        public Collection<Transaction> GetTransactionNoByOrgLevelListId(long orgLevelListId)
        {
            return transactiondata.GetTransactionNoByOrgLevelListId(orgLevelListId);
        }
    }

}

